<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>核销</title>  
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Wx/css/base.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Wx/css/detail.css" />
</head>
<body>
<div class="detail">
	<div class="product">
    	<div class="pic"><img src="<?= isMorePic($h_imgs)?>"/></div>
        <h2>{$title}</h2>
    </div>
    <div class="information">
    	<p><span>取货人</span><b>{$realname}</b></p>
    	<p><span>联系电话</span><b>{$tel}</b></p>
    	<p><span>取货份数</span><b>{$num}份（<?=$num*$u_num.getunit($unit)?>）</b></p>
    	<p><span>取货编码</span><b>{$receive}</b></p>
    </div>
    <!--<div class="button"><input type="button" value="立即核销" onclick="window.location.href='__MODULE__/Receive/cancel/oid/{$id}/'"/></div>-->
    <div class="button"><input type="button" onclick="do_send()" <in name="state" value="2,7">value="已核销" style="background:#dddddd" disabled <else />value="立即核销"</in> /></div>
</div>
<script type="text/javascript" src="__PUBLIC__/Wx/js/jquery-1.9.1.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script type="text/javascript">
    function do_send(){
        var oid = {$id};
        var g_id = {$g_id};
        var num = {$num};
        var type = {$type};
        var actual_price = {$actual_price};
        var total_fee = {$total_fee};
        var card_fee = {$card_fee};
        $.post("__MODULE__/Receive/cancel",{'oid':oid,'g_id':g_id,'num':num,'type':type,'actual_price':actual_price,'total_fee':total_fee,'card_fee':card_fee},function (d) {
            // console.log(d);return;

            if (d.state > 0){
                layer.msg(d.val, {icon:1,time:1000});
            }else{
                $(".button input").val('已核销');
                $(".button input").attr("disabled","disabled");
                $(".button input").css("background","#dddddd");
                layer.msg(d.val, {icon:1,time:1000},
                    function(){
                        window.location.href= "http://www.xiangtws.com/index.php/Wx/User/stores.html";
                    });
            }//end if
        });//end fun
    }//end fun
</script>
</body>
</html>